package com.ruoyi.disease.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.disease.mapper.DiseaseMapper;
import com.ruoyi.disease.domain.Disease;
import com.ruoyi.disease.service.IDiseaseService;

/**
 * 病症信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-19
 */
@Service
public class DiseaseServiceImpl implements IDiseaseService 
{
    @Autowired
    private DiseaseMapper diseaseMapper;

    /**
     * 查询病症信息
     * 
     * @param id 病症信息主键
     * @return 病症信息
     */
    @Override
    public Disease selectDiseaseById(Long id)
    {
        return diseaseMapper.selectDiseaseById(id);
    }

    /**
     * 查询病症信息列表
     * 
     * @param disease 病症信息
     * @return 病症信息
     */
    @Override
    public List<Disease> selectDiseaseList(Disease disease)
    {
        return diseaseMapper.selectDiseaseList(disease);
    }

    /**
     * 新增病症信息
     * 
     * @param disease 病症信息
     * @return 结果
     */
    @Override
    public int insertDisease(Disease disease)
    {
        disease.setCreateTime(DateUtils.getNowDate());
        return diseaseMapper.insertDisease(disease);
    }

    /**
     * 修改病症信息
     * 
     * @param disease 病症信息
     * @return 结果
     */
    @Override
    public int updateDisease(Disease disease)
    {
        disease.setUpdateTime(DateUtils.getNowDate());
        return diseaseMapper.updateDisease(disease);
    }

    /**
     * 批量删除病症信息
     * 
     * @param ids 需要删除的病症信息主键
     * @return 结果
     */
    @Override
    public int deleteDiseaseByIds(Long[] ids)
    {
        return diseaseMapper.deleteDiseaseByIds(ids);
    }

    /**
     * 删除病症信息信息
     * 
     * @param id 病症信息主键
     * @return 结果
     */
    @Override
    public int deleteDiseaseById(Long id)
    {
        return diseaseMapper.deleteDiseaseById(id);
    }
}
